﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSharpDemos
{
    class Program
    {
        static void Main(string[] args)
        {
            //Nullable Demo
            //NullableTypes nullableDemo = new NullableTypes();
            //nullableDemo.BoxingUnboxingForNullableTypes();

            //Console.WriteLine();

            //ToString override demo
            //OverridingToString objOverridingToString = new OverridingToString();
            //objOverridingToString.Name = "ToStringDemo";
            //objOverridingToString.Revenue = 45646877987;
            //objOverridingToString.ContactPhone = "445788977";
            //Console.WriteLine(objOverridingToString.ToString(null,new CustomFormatter()));
            //Console.WriteLine(string.Format(new CustomFormatter(), "{0}", objOverridingToString));

            //Equality
            //Console.WriteLine(new Equality(1, "A").Equals(new Equality(1, "A")));
            //Console.WriteLine(new Equality(1, "A") == new Equality(1, "A"));
            //Console.WriteLine(new Equality(1, "A") != new Equality(1, "A"));
            //Console.ReadLine();

            //Shadowing
            //DerivedClass derivedClass = new DerivedClass();
            //derivedClass.ShadowMethod();
            //((BaseClass)derivedClass).ShadowMethod();

            //Events
            Metronome m = new Metronome();
            Listener l = new Listener();
            l.Subscribe(m);
            m.Start();
        }
    }
}
